AddCSLuaFile( "cl_init.lua" )
AddCSLuaFile( "shared.lua" )
include( 'shared.lua')

util.PrecacheSound("weapons/flashbang/flashbang_explode2.wav")

function ENT:Initialize()
	self:SetModel("models/weapons/w_eq_flashbang_thrown.mdl")
	self:PhysicsInit( SOLID_VPHYSICS )
	self:SetMoveType( MOVETYPE_VPHYSICS )
	self:SetSolid( SOLID_VPHYSICS )

	local phys = self:GetPhysicsObject()
	if phys:IsValid() then
		phys:Wake()
		phys:SetVelocityInstantaneous(self:GetAngles():Forward() * 1250)
	end
	
	self.ExplodeTime = CurTime() + 3
end

function ENT:Think()
	if self.ExplodeTime < CurTime() then
		self:EmitSound("weapons/flashbang/flashbang_explode2.wav", 500)
		timer.Simple(0.1, self.Remove, self)
	end
end